home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / uiuc / RCS / phquery.h,v < prev    next >
Encoding:
Text File  |  1991-06-25  |  9.2 KB  |  388 lines

  1. head    1.7;
  2. access;
  3. symbols
  4.     RELEASE:1.7;
  5. locks; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.7
  10. date    90.12.11.12.26.59;    author paul;    state Exp;
  11. branches;
  12. next    1.6;
  13.  
  14. 1.6
  15. date    89.10.20.15.48.57;    author paul;    state Exp;
  16. branches;
  17. next    1.5;
  18.  
  19. 1.5
  20. date    89.05.10.00.59.45;    author paul;    state Exp;
  21. branches;
  22. next    1.4;
  23.  
  24. 1.4
  25. date    89.05.09.22.54.35;    author paul;    state Exp;
  26. branches;
  27. next    1.3;
  28.  
  29. 1.3
  30. date    89.05.08.20.41.57;    author paul;    state Exp;
  31. branches;
  32. next    1.2;
  33.  
  34. 1.2
  35. date    89.05.06.22.46.36;    author paul;    state Exp;
  36. branches;
  37. next    1.1;
  38.  
  39. 1.1
  40. date    89.02.13.21.43.41;    author paul;    state Exp;
  41. branches;
  42. next    ;
  43.  
  44.  
  45. desc
  46. @@
  47.  
  48.  
  49. 1.7
  50. log
  51. @Corrected handling of hyphenated names.  Added WILDNAMES #define for more
  52. aggressive matching of full name lookups.  See the comments in phquery.h.
  53. @
  54. text
  55. @/*
  56.  * @@(#)$Header: /usr/local/src/mail/sendmail/uiuc/RCS/phquery.h,v 1.6 89/10/20 15:48:57 paul Exp Locker: paul $
  57.  */
  58.  
  59. /*
  60.  * Configuration parameters.
  61.  *
  62.  * Defining EXPAND_TO will print the list of expanded addresses on an added
  63.  * X-PH-To: header line.  This will also expand names found in /usr/lib/aliases
  64.  * lists.  Leaving it undefined will cause phquery to print only a version
  65.  * line with the name of the host running phquery, e.g.,
  66.  * X-Ph: V3.5@@uxc.cso.uiuc.edu .
  67.  */
  68. /*#define        EXPAND_TO    /* Print translated addresses */
  69.  
  70. /*
  71.  * An address tested as a name is first run through as is.  If no matches
  72.  * are found then any punctuation characters are converted one at a time
  73.  * (leftmost first) to space characters and the lookup is repeated until
  74.  * there are no more punctuation characters.  If WILDNAMES is #define'd,
  75.  * a wildcard char '*' will be appended after each single character name,
  76.  * e.g. p-pomes is tried as "p* pomes".  This has risks as follows:  assume
  77.  * Duncan Lawrie sets his alias to "lawrie".  A query for d-lawrie will
  78.  * fail as a alias lookup but succeed as a name lookup when written as
  79.  * "d* lawrie".  This works until Joe Student sets his alias to "d-lawrie".
  80.  * Whoops.  Still in a non-hostile environment, this function may be more
  81.  * useful than dangerous.
  82.  */
  83. /*#define        WILDNAMES    /* Append '*' to single char names */
  84.  
  85. /* End of configurable parameters. */
  86.  
  87. /*
  88. ** Reply codes:
  89. **    1XX - status
  90. **    2XX - information
  91. **    3XX - additional information or action needed
  92. **    4XX - temporary errors
  93. **    5XX - permanent errors
  94. **    6XX - phquery specific codes
  95. */
  96. #define LR_PROGRESS    100    /* in progress */
  97. #define LR_ECHO        101    /* echoing cmd */
  98.  
  99. #define LR_OK        200    /* success */
  100. #define LR_RONLY    201    /* database ready in read only mode */
  101.  
  102. #define LR_MORE        300    /* need more info */
  103. #define LR_LOGIN    301    /* encrypt this string */
  104.  
  105. #define LR_TEMP        400    /* temporary error */
  106. #define LR_INTERNAL    401    /* database error, possibly temporary */
  107. #define LR_LOCK        402    /* lock not obtained within timeout period */
  108. #define LR_DOWN        475    /* database unavailable; try again later */
  109.  
  110. #define LR_ERROR    500    /* hard error; general */
  111. #define    LR_NOMATCH    501    /* no matches to query */
  112. #define LR_TOOMANY    502    /* too many matches to query */
  113. #define LR_AINFO    503    /* may not see that field */
  114. #define LR_ASEARCH    504    /* may not search on that field */
  115. #define LR_ACHANGE    505    /* may not change field */
  116. #define LR_NOTLOG    506    /* must be logged in */
  117. #define LR_FIELD    507    /* field unknown */
  118. #define LR_ABSENT    508    /* field not present in entry */
  119. #define LR_ALIAS    509    /* requested alias is already in use */
  120. #define LR_AENTRY    510    /* may not change entry */
  121. #define LR_ADD        511    /* may not add entries */
  122. #define LR_VALUE    512    /* illegal value */
  123. #define LR_OPTION    513    /* unknown option */
  124. #define LR_UNKNOWN    514    /* unknown command */
  125. #define LR_NOKEY    515    /* no indexed field found in query */
  126. #define LR_AUTH        516    /* no authorization for query */
  127. #define LR_READONLY    517    /* operation failed; database is read-only */
  128. #define LR_LIMIT    518    /* too many entries selected for change */
  129. #define LR_HISTORY    519    /* history substitution failed */
  130.  
  131. #define LR_SYNTAX    599    /* syntax error */
  132.  
  133. #define LR_AMBIGUOUS    600    /* ambiguous or multiple match */
  134.  
  135. #define        NONE_OF_ABOVE        -1
  136.  
  137. struct ReplyCodes {
  138.     int    key;
  139.     char    *value;
  140. } Codes[] = {
  141.     LR_PROGRESS,    "Nameserver search in progress",
  142.     LR_ECHO,    "Echoing nameserver cmd",
  143.     LR_OK,        "Success",
  144.     LR_RONLY,    "Nameserver database ready in read only mode",
  145.     LR_MORE,    "More info needed to process nameserver query",
  146.     LR_LOGIN,    "Encrypt this string",
  147.     LR_TEMP,    "Temporary nameserver error",
  148.     LR_INTERNAL,    "Nameserver database error, possibly temporary",
  149.     LR_LOCK,    "Nameserver lock not obtained within timeout period",
  150.     LR_ERROR,    "Nameserver hard error; general",
  151.     LR_NOMATCH,    "No matches to nameserver query",
  152.     LR_TOOMANY,    "Too many matches found to nameserver query",
  153.     LR_AINFO,    "May not see that nameserver field",
  154.     LR_ASEARCH,    "May not search on that nameserver field",
  155.     LR_ACHANGE,    "May not change that nameserver field",
  156.     LR_NOTLOG,    "Must be logged in to nameserver",
  157.     LR_FIELD,    "Unknown nameserver field",
  158.     LR_ABSENT,    "E-mail field not present in nameserver entry",
  159.     LR_ALIAS,    "Requested nameserver alias is already in use",
  160.     LR_AENTRY,    "May not change nameserver entry",
  161.     LR_ADD,        "May not add nameserver entries",
  162.     LR_VALUE,    "Illegal value",
  163.     LR_OPTION,    "Unknown nameserver option",
  164.     LR_UNKNOWN,    "Unknown nameserver command",
  165.     LR_NOKEY,    "No indexed field found in nameserver query",
  166.     LR_AUTH,    "No authorization for nameserver request",
  167.     LR_READONLY,    "Nameserver operation failed; database is read-only",
  168.     LR_LIMIT,    "Too many nameserver entries selected for change",
  169.     LR_HISTORY,    "History substitution failed",
  170.     LR_SYNTAX,    "Syntax error",
  171.     LR_AMBIGUOUS,    "Multiple matches found for nameserver query",
  172.     NONE_OF_ABOVE,    (char *)NULL
  173. };
  174.  
  175. /*
  176.  * Field types returned by QI.  These must be sorted in lexographic order.
  177.  */
  178. #define        ADDRESS            0
  179. #define        ALIAS            1
  180. #define        ALL            2
  181. #define        BIRTHDAY        3
  182. #define        CALLSIGN        4
  183. #define        CLASSCO            5
  184. #define        CURRICULUM        6
  185. #define        DEF_ACCOUNT        7
  186. #define        DEPARTMENT        8
  187. #define        EMAIL            9
  188. #define        FAMILY            10
  189. #define        HERO            11
  190. #define        HOME_ADDRESS        12
  191. #define        HOURS            13
  192. #define        ID            14
  193. #define        MAILCODE        15
  194. #define        MAIL_ADDRESS        16
  195. #define        NAME            17
  196. #define        NICKNAME        18
  197. #define        OFFICE_ADDRESS        19
  198. #define        OTHER            20
  199. #define        PAGER            21
  200. #define        PASSWORD        22
  201. #define        PERMANENT_ADDRESS    23
  202. #define        PHONE            24
  203. #define        PROJECT            25
  204. #define        PROXY            26
  205. #define        REVISIONS        27
  206. #define        SOUND            28
  207. #define        TITLE            29
  208. #define        TYPE            30
  209.  
  210. struct    QI_fields {
  211.     int    key;
  212.     char    *value;
  213. } Fields[] = {
  214.     ADDRESS,    "address",
  215.     ALIAS,        "alias",
  216.     ALL,        "all",
  217.     BIRTHDAY,    "birthday",
  218.     CALLSIGN,    "callsign",
  219.     CLASSCO,    "classco",
  220.     CURRICULUM,    "curriculum",
  221.     DEF_ACCOUNT,    "def_account",
  222.     DEPARTMENT,    "department",
  223.     EMAIL,        "email",
  224.     FAMILY,        "family",
  225.     HERO,        "hero",
  226.     HOME_ADDRESS,    "home_address",
  227.     HOURS,        "hours",
  228.     ID,        "id",
  229.     MAIL_ADDRESS,    "mail_address",
  230.     MAILCODE,    "mailcode",
  231.     NAME,        "name",
  232.     NICKNAME,    "nickname",
  233.     OFFICE_ADDRESS,    "office_address",
  234.     OTHER,        "other",
  235.     PAGER,        "pager",
  236.     PASSWORD,    "password",
  237.     PERMANENT_ADDRESS,    "permanent_address",
  238.     PHONE,        "phone",
  239.     PROJECT,    "project",
  240.     PROXY,        "proxy",
  241.     REVISIONS,    "revisions",
  242.     SOUND,        "sound",
  243.     TITLE,        "title",
  244.     TYPE,        "type",
  245.     NONE_OF_ABOVE,    (char *)NULL
  246. };
  247.  
  248. struct    QI_response {
  249.     int    code;
  250.     int    subcode;
  251.     int    field;
  252.     char    *message;
  253. };
  254. typedef struct QI_response QIR;
  255.  
  256. struct    NewAddress {
  257.     char    *original;
  258.     char    *new;
  259.     int    code;
  260.     QIR    *QIalt;
  261. };
  262. typedef    struct NewAddress NADD;
  263. @
  264.  
  265.  
  266. 1.6
  267. log
  268. @Added a new 400 error
  269. @
  270. text
  271. @d2 1
  272. a2 1
  273.  * @@(#)$Header: /usr/local/src/mail/sendmail/uiuc/RCS/phquery.h,v 1.5 89/05/10 00:59:45 paul Exp Locker: paul $
  274. d4 28
  275. @
  276.  
  277.  
  278. 1.5
  279. log
  280. @Final Wednesday morning clean-ups, typo-corrections, and semi-major
  281. re-write of Query().  Now handles callsigns which was easier than changing
  282. the extant documentation.  Erasing people's minds would have been tough too.
  283. -pbp
  284. @
  285. text
  286. @d2 1
  287. a2 1
  288.  * @@(#)$Header: /usr/local/src/mail/sendmail/uiuc/RCS/phquery.h,v 1.4 89/05/09 22:54:35 paul Exp Locker: paul $
  289. d26 1
  290. @
  291.  
  292.  
  293. 1.4
  294. log
  295. @First working version up to spec.  -pbp
  296. @
  297. text
  298. @d2 1
  299. a2 1
  300.  * @@(#)$Header: /usr/local/src/mail/sendmail/uiuc/RCS/phquery.h,v 1.3 89/05/08 20:41:57 paul Exp Locker: paul $
  301. a4 3
  302. /* Maximum number of suggested alternatives */
  303. #define MAXALT        25
  304.  
  305. d28 2
  306. a29 2
  307. #define    LR_NOMATCH    501    /* no matches to request */
  308. #define LR_TOOMANY    502    /* too many matches to request */
  309. d43 1
  310. a43 1
  311. #define LR_AUTH        516    /* no authorization for request */
  312. d62 1
  313. a62 1
  314.     LR_MORE,    "More info needed to process nameserver request",
  315. d68 2
  316. a69 2
  317.     LR_NOMATCH,    "No matches to nameserver request",
  318.     LR_TOOMANY,    "Too many matches found to nameserver request",
  319. @
  320.  
  321.  
  322. 1.3
  323. log
  324. @Cut after adding ReadQI function.  -pbp
  325. @
  326. text
  327. @d2 1
  328. a2 1
  329.  * @@(#)$Header: /usr/local/src/mail/sendmail/uiuc/RCS/phquery.h,v 1.2 89/05/06 22:46:36 paul Exp Locker: paul $
  330. d8 9
  331. a16 3
  332. /***********************************************************************
  333. * Reply codes
  334. ***********************************************************************/
  335. d53 2
  336. d91 1
  337. a167 7
  338. struct    NewAddress {
  339.     char    *original;
  340.     char    *new;
  341.     int    code;
  342.     char    *alternatives[MAXALT];
  343. };
  344.  
  345. d174 1
  346. d176 6
  347. a182 2
  348. typedef struct QI_response QIR;
  349.  
  350. @
  351.  
  352.  
  353. 1.2
  354. log
  355. @Added QI response fields.  -pbp
  356. @
  357. text
  358. @d2 1
  359. a2 1
  360.  * @@(#)$Header: /usr/local/src/mail/sendmail/uiuc/RCS/phquery.h,v 1.1 89/02/13 21:43:41 paul Exp Locker: paul $
  361. d47 2
  362. d83 1
  363. a83 1
  364.     -1,        (char *)NULL
  365. a120 2
  366. #define        NONE_OF_ABOVE        -1
  367.  
  368. d124 1
  369. a124 1
  370. } Fields = {
  371. @
  372.  
  373.  
  374. 1.1
  375. log
  376. @Initial revision
  377. @
  378. text
  379. @d2 1
  380. a2 1
  381.  * @@(#)$Header$
  382. d5 3
  383. d84 75
  384. d163 1
  385. d166 7
  386. d174 1
  387. @
  388.